
#ifndef __mem_alloc__
#define __mem_alloc__

#include "common.h"

void os_mem_pool_creat(void);

#if (DBG_EN+MALLOC_DBG_EN) > 1
void  * os_malloc(uint32_t size, char *file, int line);
void  * os_calloc(uint32_t items, uint32_t size, char *file, int line);
void  os_free(void * pdat, char *file, int line);

#define mem_malloc(size)  os_malloc(size, __FILE__, __LINE__)
#define mem_calloc(items, size)  os_calloc(items, size, __FILE__, __LINE__)
#define mem_free(pdat)    os_free(pdat, __FILE__, __LINE__)

#else

void  * os_malloc(uint32_t size);
void  * os_calloc(uint32_t items, uint32_t size);
void  os_free(void * pdat);

#define mem_malloc  os_malloc
#define mem_calloc  os_calloc
#define mem_free    os_free
#endif

#endif  // __mem_alloc__
